package com.hdoit.kylin.web.baseInfo.modelconfig;

import com.tennetcn.common.enums.regular.RegularExpressions;
import com.tennetcn.component.attribute.DisplayNameAttribute;
import com.tennetcn.component.attribute.DropDownListAttribute;
import com.tennetcn.component.attribute.RegularExpressionAttribute;
import com.tennetcn.component.attribute.RequiredAttribute;
import com.tennetcn.component.attribute.base.ModelMetadataAttributeConfiguration;

public class SchoolConfig extends ModelMetadataAttributeConfiguration {
	public SchoolConfig() {
		this.setProperty("schoolName")
			.hasAttribute(new DisplayNameAttribute("学校名"))
			.hasAttribute(new DropDownListAttribute())
			.hasAttribute(new RequiredAttribute("学校名为必填项"));
		
		this.setProperty("province")
			.hasAttribute(new DisplayNameAttribute("省份"))
			.hasAttribute(new DropDownListAttribute());
		
		this.setProperty("city")
			.hasAttribute(new DisplayNameAttribute("市"))
			.hasAttribute(new DropDownListAttribute());
		
		this.setProperty("address")
			.hasAttribute(new DisplayNameAttribute("地址"));
		
		this.setProperty("postcode")
			.hasAttribute(new DisplayNameAttribute("邮编"))
			.hasAttribute(new RegularExpressionAttribute(RegularExpressions.zipCode));
		
		this.setProperty("phone")
			.hasAttribute(new DisplayNameAttribute("电话"))
			.hasAttribute(new RegularExpressionAttribute(RegularExpressions.mobile));
		
		this.setProperty("homepage")
			.hasAttribute(new DisplayNameAttribute("网址"))
			.hasAttribute(new RequiredAttribute("网址为必填项"));
	}
}
